<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
<a href="javascript:toPage(3)">首页</a></li>
<a href="javascript:toPage(1)">上一页</a>
<a href="javascript:toPage(2)">下一页</a>
<a href="javascript:toPage(4)">尾页</a>
当前第<input type="text" id="pageNum" name="pageNum" size="1">页
每页<input type="text" id="pageSize" name="pageSize" size="1">条
共<input type="text" id="totalPage" readonly="readonly" size="1">页
共<input type="text" id="totalCount" readonly="readonly" size="1">条
</body>
</html>
<script type="text/javascript">
function toPage(flag){
	var pageNumber = parseInt($("#pageNum").val());
	var totalPage = parseInt($("#totalPage").val());
	if(flag == 1){
		if(pageNumber <= 1){
			//alert("已经是首页");
            toastr.success("已经是首页");

			return;
		}
		$("#pageNum").val(pageNumber - 1);
	}else if(flag == 2){
		if(pageNumber >= totalPage){
			//alert("已经是尾页");
            toastr.success("已经是尾页");
			return;
		}
		$("#pageNum").val(pageNumber + 1);
	}else if(flag == 3){
		if(pageNumber <= 1){
			//alert("已经是首页");
            toastr.success("已经是首页");
			return;
		}
		$("#pageNum").val(1);
	}else if(flag == 4){
		if(pageNumber >= totalPage){
			//alert("已经是尾页");
            toastr.success("已经是尾页");
			return;
		}
		$("#pageNum").val(totalPage);
	}
    getCar();
}

function pageInstall(page){
	//获取页面文本框并赋值 (当前页数)
	$("#pageNum").val(page.pageNum);
	$("#pageSize").val(page.pageSize);
	$("#totalPage").val(page.lastPage);
	$("#totalCount").val(page.total);
}
</script>